package com.main.tripplanner.persistent;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="cities")
public class City extends PersistentEntity{
	private String name;
	private float time;
	private int timeVotes;
	private Country country;
	
	
	@Id
	@Column(name="city_id")
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	@Column(name="name")
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@Column(name="time_to_spend")
	public float getTime() {
		return time;
	}
	public void setTime(float time) {
		this.time = time;
	}
	
	@Column(name="time_votes")
	public int getTimeVotes() {
		return timeVotes;
	}
	public void setTimeVotes(int timeVotes) {
		this.timeVotes = timeVotes;
	}
	
	@JoinColumn(name="country_id")
	@ManyToOne(fetch = FetchType.EAGER)
	public Country getCountry() {
		return country;
	}
	public void setCountry(Country country) {
		this.country = country;
	}
	
	
	
	
}
